using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

public class BaiduMap
{
    public static string GetRouteResponse(string ak, string sk, string url, IDictionary<string, string> querystring_arrays)
    {
        var sn = AKSNCaculater.CaculateAKSN(ak, sk, url, querystring_arrays);
        Console.WriteLine(sn);

        var queryString = AKSNCaculater.HttpBuildQuery(querystring_arrays);
        var completeUrl = string.Format("http://api.map.baidu.com" + url + "?" + queryString + "&sn=" + sn);
        var str = HouseCrawler.GetHtmlText(completeUrl, Encoding.Default);
        Console.WriteLine(completeUrl);
        return str;
    }

    public static string GetRouteResponse(string ak, string url, IDictionary<string, string> querystring_arrays)
    {
        var queryString = AKSNCaculater.HttpBuildQuery(querystring_arrays);
        var completeUrl = string.Format("http://api.map.baidu.com" + url + "?" + queryString);
        var str = HouseCrawler.GetHtmlText(completeUrl, Encoding.Default);

        return str;
    }

}